home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 1995 #5 & #6 / Amiga Plus CD - 1995 - No. 5 and 6.iso / pd / daten / astrolog / src / bugs < prev    next >
Text File  |  1995-08-11  |  7KB  |  188 lines

  1.  
  2. Dear "Mr. Astrolog" Pullen,  (":
  3.  
  4. I ported Astrolog for Amiga systems and this is a bug report which conatins
  5. all those bugs which I found or which have been reported to me (or at least
  6. most of them, I hope :)  However, it also contains my personal suggestions.
  7.  
  8. I tried to reach you via E-Mail, but all my attempts failed.  Mails either
  9. bounced, reached the wrong people or simply got lost somewhere in the depth
  10. of the Internet.  I even tried to upload it to ftp.u.washington.edu, but
  11. I had no write permission there.  This is why I decided to post my mail into
  12. this group, perhaps starting an RFC for Astrolog ;-)
  13.  
  14. ******************************************************************************
  15. ** ASTROLOG BUGS
  16. ******************************************************************************
  17.  
  18. o  Some chart types expect certain resulutions which might be too large for
  19.    the system display.  You handle them [e.g. in "xscreen.c", InteractX()]
  20.    like that:
  21.  
  22.      if(gs.xWin > BITMAPX)
  23.        gs.xWin = BITMAPX;
  24.  
  25.    However, since clipping is not handled in the turtle stuff, you might
  26.    run off the borders nevertheless.  [see also "turtle metric" and "compiling
  27.    turtles" ideas below].
  28.  
  29. o  Astrolog used to "forget" the former X/Y resolution when switching to
  30.    certain chart types, like the world map and aspect grids which must
  31.    always be at a certain size.  This is however a non-amiga-specific
  32.    astrolog problem which has been fixed using a quick hack.
  33.  
  34.    (Bug reported by Robin Reynolds,astarte@solar.sky.net)
  35.  
  36.    Note:  The problem occured when switching back to a chart type which does
  37.    not depend on a certain resulution (like the chart wheel).  In this case
  38.    you kept using the new resolution instead of the former one.
  39.  
  40. o  Astrolog's non-deterministic algorithm for symbol collision in a chart
  41.    does not do anything if there are three symbols with an exact equal
  42.    position.  (even if there would be enough room to spread them along the
  43.    zodiac)
  44.  
  45. o  In gAstroGraph mode:  The Time/Location information is gets printed *over*
  46.    the symbols which doesn't look very nice.
  47.  
  48. o  In graphics mode: `-Ky' does not work, but only `-K'.
  49.  
  50.  
  51. ******************************************************************************
  52. ** NON SYSTEM-SPECIFIC MODIFICATIONS
  53. ******************************************************************************
  54.  
  55. o  Many compilers return LMT with the time() call which always leads to
  56.    problems for the user when he (or she) tries to setup the `-z' and `-z0'
  57.    settings in "astrolog.dat".  The hint "Set your TZ variable correctly"
  58.    often is not of great help since the compiler might not take advantage of
  59.    it.
  60.  
  61.    For the Amiga version I introduced an environment variable GMTOFF, which
  62.    must be set to the #of seconds which the system clock differs from UT.
  63.    This avoids side effects because `-z' and `-z0' can be set to the correct
  64.    values.  However, the behaviour of GetTimeNow() is a little bit funny:
  65.    We compute GMT from LMT via GMTOFF and you make LMT of it again using the
  66.    `-z' and `-z0' settings:  "Time Zone ping-pong"  :-)
  67.  
  68. o  astrolog.h line 1167 & extern.h line 127:
  69.  
  70.    #ifdef PI
  71.    #undef PI
  72.    #endif /*PI*/
  73.  
  74.    Well, the name "PI" is not a very good choice here... (-:
  75.  
  76. o  astrolog.c: return type of main() changed from `void' to `int'
  77.  
  78. o  data.c:115: initializer element is not constant
  79.  
  80.     FILE *S = stdout;  /* initialization moved to main() */
  81.  
  82.    For some compilers (like GNU C), the standard I/O streams are not constant
  83.    and thus cannot be use to initialize static or global variables (in the data
  84.    section).
  85.  
  86. o  general.c:652:  sign = (int)floor(deg / 30.0);
  87.                                ^^^^^
  88.     otherwise the degree value `d' might become negative
  89.  
  90.  
  91. o  general.c:663:  d = (int)floor(deg / 15.0);
  92.                             ^^^^^
  93.     otherwise the minutes value `m' might become negative
  94.  
  95. o  Take a look at the slightly improved version of NFromPch().  Even if `str'
  96.    is accessed only once, we have one less dereference of *str.  (-:
  97.  
  98.  
  99. ******************************************************************************
  100. ** IDEAS & SUGGESTIONS
  101. ******************************************************************************
  102.  
  103. o  Allow a seperate file for the turtle definitions and perhaps "compiling"
  104.    them to a format which is faster to interpret and allows optimisation.
  105.  
  106.    -  Numbers are int's and we don't need NFromPch() anymore.
  107.  
  108.    -  A metric rectangle can be part of the turtle which allows a quick
  109.       descision whether or not this turtle fits into the current display
  110.       and we don't need to handle the clipping for every pixel to draw.
  111.  
  112. o  Make Astrolog free of system dependent stuff in #if ... clauses which
  113.    only leads to unreadable code.  Much better would be a system interface
  114.    which allows linking of some X11.o, PCG.o, MAC.o or Amiga.o depending on
  115.    the system for which astrolog is to be compiled on.  Each of these files
  116.    must provide a set of well defined functions and procedures (mainly for
  117.    the graphics, but also for future versions which might have a GUI :-).
  118.  
  119.    In order to avoid problems with the function names, there should be an
  120.    interface with stub functions which are used by astrolog.  If these were
  121.    put into a file "machine.c" then we can be sure that this is the *only*
  122.    place where the system specific functions are called.
  123.  
  124.    This makes porting Astrolog to other platforms *much* easier.
  125.  
  126. o  I made a Texinfo version of "HELPFILE.440".  Texinfo is a HyperText format
  127.    which can be converted to PostScript, DVI (TeX), HTML, AmigaGuide, etc.
  128.    It would make things much easier if you could maintain and update the
  129.    astrolog.texinfo file instead of the helpfile.  (-:
  130.  
  131.    Note that you can create an ASCII file from the .texinfo file as well, so
  132.    using Texinfo is not a loss, but only a bonus!
  133.  
  134.  
  135. ******************************************************************************
  136. ** GENERAL NOTES
  137. ******************************************************************************
  138.  
  139. +  You used boolean values in integer arithmetics everywhere in the code.
  140.    This is somewhat dangerous because (1==1) is only guaranteed to be
  141.    something != 0, hence ((1==1)==1) can be false!
  142.  
  143.    Solution: instead of writing
  144.  
  145.      i = 42 + (x==y);
  146.  
  147.    use something like
  148.  
  149.      i = 42 + ( (x==y) ? 1:0 );
  150.  
  151.  
  152. +  The readability of large parts in the code could be improved if your
  153.    PrintXXX() functions would make use of the varargs mechanism with a
  154.    printf()-like format string.  Actually each procedure writing some
  155.    output needs it's own string buffer (often called sz[]) and contains
  156.    several lines which look like that:
  157.  
  158.       sprintf(sz, "foo", bar);
  159.       PrintXXX(sz);
  160.  
  161.    I've written some procedures which do that, replacing e.g. the DrawPrint()
  162.    function from "xcharts0.c".  You might want to have a look at the
  163.    xPrintAt() procedure in "xtras.c" which allows writing the above like 
  164.    that:
  165.  
  166.       xPrint("foo",bar);
  167.  
  168.    The xPrint() functions even allow switching to a different color within
  169.    one single call.  Example:
  170.  
  171.       xPrint("{green}foo{white}%s\n",bar);
  172.  
  173. +  In some places, an #else clause after an #ifdef X11 is used instead of
  174.    an #ifdef PCG which implies mistakenly that everything which is not X11
  175.    must be PCG.
  176.  
  177. ******************************************************************************
  178.  
  179.  
  180.  
  181. Please write to me!
  182.  
  183.   -Tobi
  184.  
  185.  
  186. ----
  187. Tobias Ferber <ukjg@rz.uni-karlsruhe.de> or <tf@antares.ping.de>
  188.